function printLabel(labelObject: { label: string }) {
  console.log(labelObject.label);
}
let myObj = {
  size: 10,
  label: "Size 10 Object",
};
printLabel(myObj);

interface SquareConfig {
  color?: string;
  width?: number;
  [propName: string]: any;
}
function createSquare(config: SquareConfig): { color: string; area: number } {
  let newSquare = {
    color: "white",
    area: 100,
  };
  if (config.color) {
    newSquare.color = config.color;
  }
  if (config.width) {
    newSquare.area = config.width * config.width;
  }
  return newSquare;
}
let mySquare = createSquare({ color: "black", width: 100 });
let mySquare2 = createSquare({colour: 'white'})
console.log(mySquare);

interface Point {
  readonly x: number;
  readonly y: number;
}
let p1: Point = { x: 10, y: 20 };
console.log(p1);

let a: number[] = [1, 2, 3, 4];
let b: ReadonlyArray<number> = [...a];
a[0] = 2;
console.log(a, b)
a = b as number[];
console.log(a)